/*
 *  Copyright (C) 2010 glauco
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.balisunrise.common.abstracts;

/**
 *
 * @author Glauco
 * @see org.balisunrise.common.EntityField
 */
public abstract class AbstractEntityField extends AbstractBasic{

    public static final String PROP_FIELDCLASS = "fieldClass";
    public static final String PROP_FIELDNAME = "fieldName";
    public static final String PROP_ENTITYCLASS = "entityClass";
    public static final String PROP_ALIAS = "alias";

    protected Class fieldClass;
    protected String fieldName;
    protected Class entityClass;
    protected String alias;
    
    /**
     * Get the value of alias
     *
     * @return the value of alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * Set the value of alias
     *
     * @param alias new value of alias
     */
    public void setAlias(String alias) {
        String oldAlias = this.alias;
        this.alias = alias;
        changeSupport.firePropertyChange(PROP_ALIAS, oldAlias, alias);
    }


    /**
     * Get the value of entityClass
     *
     * @return the value of entityClass
     */
    public Class getEntityClass() {
        return entityClass;
    }

    /**
     * Set the value of entityClass
     *
     * @param entityClass new value of entityClass
     */
    public void setEntityClass(Class entityClass) {
        Class oldEntityClass = this.entityClass;
        this.entityClass = entityClass;
        changeSupport.firePropertyChange(PROP_ENTITYCLASS,
                oldEntityClass, entityClass);
    }

    /**
     * Get the value of fieldClass
     *
     * @return the value of fieldClass
     */
    public Class getFieldClass() {
        return fieldClass;
    }

    /**
     * Set the value of fieldClass
     *
     * @param fieldClass new value of fieldClass
     */
    public void setFieldClass(Class fieldClass) {
        Class oldFieldClass = this.fieldClass;
        this.fieldClass = fieldClass;
        changeSupport.firePropertyChange(PROP_FIELDCLASS,
                oldFieldClass, fieldClass);
    }

    /**
     * Get the value of fieldName
     *
     * @return the value of fieldName
     */
    public String getFieldName() {
        return fieldName;
    }

    /**
     * Set the value of fieldName
     *
     * @param fieldName new value of fieldName
     */
    public void setFieldName(String fieldName) {
        String oldFieldName = this.fieldName;
        this.fieldName = fieldName;
        changeSupport.firePropertyChange(PROP_FIELDNAME,
                oldFieldName, fieldName);
    }


}
